Skip to content

Conversation

@cgoldberg
Copy link
Member

@cgoldberg cgoldberg commented Oct 29, 2025

User description

🔗 Related Issues

#16432
#11442

💥 What does this PR do?

This PR adds ruff rules for docstring linting in Python. It also fixes many violations to make docstrings more consistent and adhere to google-style.

💡 Additional Considerations

As we continue to fix docstrings, we will remove ignored rules from extend-ignore until ruff can run clean with no violations.

🔄 Types of changes

  • Cleanup (formatting, renaming)

PR Type

Enhancement, Tests


Description

  • Add ruff docstring linting rules (D) to enforce Google-style formatting

  • Fix docstring formatting across 40+ Python files for consistency

  • Move closing triple quotes to separate lines for multi-line docstrings

  • Remove blank lines after docstring opening and before closing quotes

  • Configure ruff with Google convention and ignore rules for gradual cleanup


File Walkthrough

Relevant files
Configuration changes
1 files
pyproject.toml
Add ruff docstring linting rules configuration                     
+18/-1   
Formatting
39 files
generate_api_module_listing.py
Fix module-level docstring formatting                                       
+2/-1     
exceptions.py
Fix exception class docstring formatting                                 
+18/-9   
options.py
Fix docstring escape sequence formatting                                 
+1/-1     
webdriver.py
Fix ChromiumDriver docstring formatting                                   
+2/-2     
action_chains.py
Fix action chains method docstrings                                           
+2/-8     
input_device.py
Remove empty docstring from add_action method                       
+0/-1     
network.py
Fix network handler docstring formatting                                 
+0/-6     
script.py
Fix script execution docstring formatting                               
+0/-1     
log.py
Fix async logging method docstrings                                           
+0/-3     
options.py
Fix options class docstring formatting                                     
+4/-2     
proxy.py
Fix Proxy class docstring formatting                                         
+2/-1     
selenium_manager.py
Fix selenium manager method docstrings                                     
+0/-2     
service.py
Fix service class method docstrings                                           
+4/-3     
timeouts.py
Fix Timeouts constructor docstring formatting                       
+0/-1     
virtual_authenticator.py
Fix authenticator decorator docstrings                                     
+4/-3     
firefox_binary.py
Fix firefox binary method docstring                                           
+2/-1     
firefox_profile.py
Fix firefox profile docstring formatting                                 
+6/-4     
options.py
Fix firefox options property docstrings                                   
+4/-2     
webdriver.py
Fix Firefox driver docstring formatting                                   
+0/-2     
webdriver.py
Fix IE driver docstring formatting                                             
+2/-2     
file_detector.py
Fix FileDetector class docstring                                                 
+2/-1     
remote_connection.py
Fix remote connection method docstring                                     
+0/-1     
webdriver.py
Fix remote webdriver docstring formatting                               
+2/-7     
webelement.py
Remove outdated Cygwin path example                                           
+0/-2     
options.py
Fix Safari options descriptor docstring                                   
+2/-0     
color.py
Fix Color class docstring formatting                                         
+0/-1     
event_firing_webdriver.py
Fix EventFiringWebDriver docstring                                             
+2/-1     
relative_locator.py
Fix relative locator method docstring                                       
+2/-1     
select.py
Fix Select class docstring formatting                                       
+5/-3     
options.py
Fix WebKitGTK options docstring formatting                             
+2/-1     
webdriver.py
Fix WebKitGTK driver docstring formatting                               
+2/-2     
options.py
Fix WPEWebKit options docstring formatting                             
+4/-2     
webdriver.py
Fix WPEWebKit driver docstring formatting                               
+2/-2     
bidi_webextension_tests.py
Remove blank lines after test docstrings                                 
+0/-5     
example2.py
Fix test example docstring formatting                                       
+2/-1     
interactions_tests.py
Fix test docstring formatting                                                       
+1/-2     
interactions_with_device_tests.py
Fix test docstring formatting                                                       
+1/-2     
page_loader.py
Fix module docstring formatting                                                   
+2/-1     
webserver.py
Fix module docstring formatting                                                   
+2/-1     

@selenium-ci selenium-ci added C-py Python Bindings B-devtools Includes everything BiDi or Chrome DevTools related B-support Issue or PR related to support classes labels Oct 29, 2025
@cgoldberg cgoldberg merged commit 878317f into SeleniumHQ:trunk Oct 29, 2025
27 checks passed
@cgoldberg cgoldberg deleted the py-add-ruff-docstring-rules branch October 29, 2025 15:25
@SeleniumHQ SeleniumHQ deleted a comment from qodo-merge-pro bot Oct 29, 2025
@SeleniumHQ SeleniumHQ deleted a comment from qodo-merge-pro bot Oct 29, 2025
@SeleniumHQ SeleniumHQ deleted a comment from selenium-ci Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-devtools Includes everything BiDi or Chrome DevTools related B-support Issue or PR related to support classes C-py Python Bindings Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants